package com.purengage.ipilih;

import java.util.ArrayList;
import java.util.HashMap;

import com.purengage.ipilih.lib.CustomAdapter;

import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListAdapter;
import android.widget.TextView;

public class TPS extends ListActivity{
	public ListAdapter adapter;
	public int jml = 4;
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tps);
		TextView jumlah = (TextView) findViewById(R.id.jmlTPS);
		
		ArrayList<HashMap<String, Object>> list = new ArrayList<HashMap<String, Object>>();

		for (int k = 1; k <= jml; k++) {
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put("tps", R.drawable.tps_g);
			map.put("namatps", "TPS "+k+" (Kenep)");
			list.add(map);
			Log.d("list", String.valueOf(list));
		}
		
		adapter = new CustomAdapter(this, list,
				R.layout.list_activity_tps,
				new String[] { "tps", "namatps" }, new int[] { R.id.tps,
						R.id.TPSname });
		jumlah.setText("("+String.valueOf(jml)+")");
		setListAdapter(adapter);

	}
}
